package com.kpmg.datalake.common.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * @author Alex.zhao [alex.zhao@kpmg.com]
 * @since Created on azhao6 on 2018-08-21 23:06:21
 */
public interface SqlLoaderService {

  /**
   * 加载数据
   * @param projectId 项目ID
   * @param fileList 文件列表
   * @return Map
   * @throws IOException 文件异常
   * @throws InterruptedException 线程异常
   * @throws ExecutionException 执行异常
   */
  Map<String, Map<String, String>> loaderData(String projectId, List<String> fileList)
      throws IOException, InterruptedException, ExecutionException;


  /**
   * 从文件中加载数据
   * @param projectId 项目ID
   * @param tableName 表名
   * @param headFile 表头文件
   * @param dataFile 数据文件
   * @return Map
   * @throws IOException 文件异常
   * @throws InterruptedException 线程异常
   * @throws ExecutionException 执行异常
   */
  Map<String, String> loaderDataFromFile(String projectId, String tableName, String headFile,
      String dataFile)
      throws IOException, InterruptedException, ExecutionException;
}
